/********************************************************/
/*	Author:		gong_libin			*/
/*	Date:		2017_11_01			*/
/*	File:		CmLoggerTest.cpp		*/
/********************************************************/

#include "CmLogger.h"

int main(int argc, char* argv[])
{
	CMADXINFO_S stInfo;

	// request
	stInfo.m_uiVer = 1;
	stInfo.m_CCtxtid = "CmContextId";
	stInfo.m_CIP = "192.168.100.200";
	stInfo.m_CUid = "CmUserId";
	stInfo.m_CMac = "08:00:27:9a:2d:82";
	stInfo.m_CGps = "36.00929,108.2394823";
	stInfo.m_CImei = "CmUserImei";
	stInfo.m_CUa = "Mozilla/5.0 (Windows NT 10.0;WOW64) AppleWebKit/537.36(KHTML, like Gecko) Chrom/60.0.31112.78 Safari/537.36";
	stInfo.m_CDid = "CmDeveloperId";
	stInfo.m_CAid = "CmAppId";
	stInfo.m_CEid = "CmExhibitionId";
	stInfo.m_CCid = "CmChannelId";
	stInfo.m_CCats = "1,2,3,4,5,6,";
	stInfo.m_CType = "1";
	stInfo.m_CWidth = "1280";
	stInfo.m_CHeight = "300";
	stInfo.m_CScaling = "1.6";
	stInfo.m_uiCrtView = 1;
	stInfo.m_uiMinPrice = 800;
	// response
	stInfo.m_CAdvId = "AdvId";
	stInfo.m_CDesUrl = "http://www.destination.com";
	stInfo.m_CClkUrl = "http://www.click_through_url.com";
	stInfo.m_CSupUrl = "http://www.supervisory_url.com";
	stInfo.m_CExtend = "hello adx";
	stInfo.m_CCategory = "3";
	stInfo.m_uiMaxPrice = 850;
	stInfo.m_CCrtId  = "100";
	stInfo.m_CCrtTitle = "creative title";
	stInfo.m_uiCrtType = 1;
	
	CCmLogger CLog(&stInfo);

	CLog.CmLoggerSetDspId(111);
	CLog.CmLoggerSetMsgType(222);
	CLog.CmLoggerSetResCode(333);
	CMSTR_C CLine = CLog.CmLoggerSerialize();
	CM_PRINT("CmLoggerSerialize: %s", CLine.c_str());

	return CM_SUCCESS;
}
